<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.springframework.org/schema/data/jaxb">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <link th:href="@{/managerstatic/plugins/layui/css/layui.css}" rel="stylesheet" media="all" />

</head>
<body>
<iframe id="aframe" name="aframe" src="movieshow/index.html" frameborder="0"  marginheight="0" marginwidth="0" width="100%" height="100%"></iframe>

    <ul class="layui-timeline">
        <li class="layui-timeline-item">
            <i class="layui-icon layui-anim layui-anim-rotate layui-anim-loop layui-timeline-axis"></i>
            <div class="layui-timeline-content layui-text">
                <!--<table class="layui-hide" id="demo" lay-filter="test">-->
                <table id="demo"  lay-filter="test" class="layui-table" lay-data="{id: 'idTest'}"></table>
            </div>
        </li>
    </ul>
<!--</div>-->

<script th:src="@{/managerstatic/plugins/jquery.min.js}"></script>
<script th:src="@{/managerstatic/plugins/layui/layui.js}"></script>
<script th:inline="javascript">
    var url=[[@{/}]]
</script>
<script type="text/javascript" th:inline="none">
    var websocket;
    // 首先判断是否 支持 WebSocket
    if('WebSocket' in window) {
        websocket = new WebSocket("ws://localhost:8080/wsMy?jspCode=AA");
    } else if('MozWebSocket' in window) {
        websocket = new MozWebSocket("ws://localhost:8080/wsMy?jspCode=AAA");
    } else {
        websocket = new SockJS("ws://localhost:8080/wsMy?jspCode=A");
    }

    // 打开连接时
    websocket.onopen = function(event) {
        console.log(" websocket.onopen  ");
    };

    // 收到消息时
    websocket.onmessage = function(event) {
        // console.log("收到一条消息"+event.data);
        // alert(event.data);
        layui.use('table', function(){
            var table = layui.table;
            // var html = '<iframe src="'+'/moviemanager/pages/userRights/user_lc.html'+'" frameborder="no" height="520px" width="100%"></iframe>';
            var html = '<iframe src="'+'/schedule/msg'+'" frameborder="no" height="520px" width="100%"></iframe>';
            layer.open({
                area: ['900px', '500px'],
                title: '热点推送',
                    type: 1
                ,content:html
            });
        });
    };

    websocket.onerror = function(event) {
        console.log("  websocket.onerror  ");
    };

    websocket.onclose = function(event) {
        console.log("  websocket.onclose  ");
    };
</script>
</body>
</html>